package day7;

import java.util.Arrays;

/**
 * @Author juzipi
 * @Date 2021/6/11 14:14
 * @Info
 */
public class BubbleSortDemo {

    public static void main(String[] args) {

        int[] arr = new int[]{45,64,245,12,1,24,34,2,10,457,1454,4651651,4651,98494,984764165,113,121,54,651,51};
        for (int i = 0; i < arr.length -1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j+1]){
                    int temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }

        System.out.println(Arrays.toString(arr));
    }

}
